# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=pam-u2f
pkgver=1.0.8
pkgrel=0
pkgdesc="Pluggable Authentication Module (PAM) for U2F"
url="https://developers.yubico.com/pam-u2f/"
arch="all !s390x" # Limited by libu2f-server-dev
license="BSD-2-Clause"
makedepends="libu2f-server-dev libu2f-host-dev linux-pam-dev"
options="!check" # need yubikey plugged in on live machine
subpackages="$pkgname-doc"
source="https://developers.yubico.com/pam-u2f/Releases/pam_u2f-$pkgver.tar.gz"
builddir="$srcdir/pam_u2f-$pkgver"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-pam-dir=/lib/security
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="0bdbea6307428bbed2af69129af207304f7951418ad7df339563f47d678a2cfe6b80321552382e15771cfc06306fae746521850056376f533c430556d051ad36  pam_u2f-1.0.8.tar.gz"
